/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.epam.debrecen.hackathon.ai.model;

public enum Card {

	ONE("1", 1, 10, true), TWO("2", 2, 8, true), THREE("3", 3, 8, true), FOUR("4", 4, 8, true), FIVE("5", 5, 8, true), SIX("6", 6, 8, true), TEN("10", 10, 8, true), COURTESAN("Courtesan", 1, 12,
			false), HEROINE("Heroine", 10, 3, false), WINTER("Winter", 0, 3, false), SPRING("Spring", 0, 3, false), BISHOP("Bishop", 0, 6, false), DRUMMER("Drummer", 0, 6, false), SCARECROW(
			"Scarecrow", 0, 16, false), SURRENDER("Key", 0, 3, false);
	private String name;
	private int value;
	private int count;
	private boolean mercenary;

	private Card(String name, int value, int count, boolean mercenary) {
		this.name = name;
		this.value = value;
		this.count = count;
		this.mercenary = mercenary;
	}

	public int getCount() {
		return this.count;
	}

	public String getName() {
		return this.name;
	}

	public int getValue() {
		return this.value;
	}

	public boolean isMercenary() {
		return this.mercenary;
	}

	public static Card fromName(String name) {
		for (Card card : Card.values()) {
			if (card.name.equals(name)) {
				return card;
			}
		}
		return null;
	}
}
